<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?>

<?php 
	$ci = & get_instance();
	$live_tournament_array = $ci->tournament_entity->getTournamentByStatus("living");
?>
<div class="block" id="live_tournament_div">	
	<div class="clrboth"></div>
	<div class="content-wrap" id="div_live_tournament">
		<?php foreach($live_tournament_array as $item): ?>
			<?php $TOURNAMENT = $ci->tournament_entity->init('id', $item->id);?>
			<div class="wrap-title">
				<!-- <span class="bold"><?php /* echo sysDateFormat($TOURNAMENT->getStartTime());*/?></span> | -->
				<span class="blue_bold"><a href="<?php echo site_url("cricket/tournament/match/?tid=".$TOURNAMENT->getId()."&scrid=".mCrypt($TOURNAMENT->getId()));?>"><?php echo $TOURNAMENT->getName();?></a></span>
				
				<span class="blue_bold">
				|
					<?php echo date('F d',$TOURNAMENT->getStartTime());?> to 
					<?php echo date('F d',$TOURNAMENT->getEndTime());?>
				</span>
			</div>	
				<div class="clrboth"></div>
				<?php /*echo cutString($TOURNAMENT->getDescription(),howManyWordToCut());*/
					echo $TOURNAMENT->getDescription();
				?>
				<div class="clrboth"></div>
				<div class="playnow" onclick="return gotoTournament('<?php echo site_url("cricket/tournament/match/?tid=".$TOURNAMENT->getId()."&scrid=".mCrypt($TOURNAMENT->getId()));?>');">
					<a href="javascript:void(0);" >&nbsp;</a>
				</div>
		 
			<div class="clrboth"></div>
		<?php endforeach;?>	
	</div>
</div>

<div id="home-banner">
	{pyro:sys:homebanner}
</div>


<script type="text/javascript">
	function gotoTournament(link){
		queryURL(link);
	}
</script>
